package com.chanta.server.persistence;

import java.util.Date;
import java.util.List;
import java.util.Set;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

/**
 * 
 * TODO Please comment this class..
 * 
 * @author Hakan Özdemir - Vendoo Inc.
 * @date 06.11.2013
 * 
 */
@PersistenceCapable
public class Item {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;

	@Persistent
	private String name;

	@Persistent
	private String description;

	@Persistent
	private String smallHeader;

	@Persistent
	private String state;

	/** do not rename */
	@Persistent
	private Template template;

	@Persistent
	private Date creationDate;

	@Persistent
	private Set<Key> libraries;

	@Persistent(defaultFetchGroup = "true", mappedBy = "item")
	private List<ItemImage> itemImages;

	/**
	 * Getter for name.
	 * 
	 * @return name
	 */
	public String getName() {
		return name;
	}

	/**
	 * Setter for name.
	 * 
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Getter for description.
	 * 
	 * @return description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * Setter for description.
	 * 
	 * @param description
	 *            the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * Getter for smallHeader.
	 * 
	 * @return smallHeader
	 */
	public String getSmallHeader() {
		return smallHeader;
	}

	/**
	 * Setter for smallHeader.
	 * 
	 * @param smallHeader
	 *            the smallHeader to set
	 */
	public void setSmallHeader(String smallHeader) {
		this.smallHeader = smallHeader;
	}

	/**
	 * Getter for state.
	 * 
	 * @return state
	 */
	public String getState() {
		return state;
	}

	/**
	 * Setter for state.
	 * 
	 * @param state
	 *            the state to set
	 */
	public void setState(String state) {
		this.state = state;
	}

	/**
	 * Getter for template.
	 * 
	 * @return template
	 */
	public Template getTemplate() {
		return template;
	}

	/**
	 * Setter for template.
	 * 
	 * @param template
	 *            the template to set
	 */
	public void setTemplate(Template template) {
		this.template = template;
	}

	/**
	 * Getter for creationDate.
	 * 
	 * @return creationDate
	 */
	public Date getCreationDate() {
		return creationDate;
	}

	/**
	 * Setter for creationDate.
	 * 
	 * @param creationDate
	 *            the creationDate to set
	 */
	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

	/**
	 * Getter for libraries.
	 * 
	 * @return libraries
	 */
	public Set<Key> getLibraries() {
		return libraries;
	}

	/**
	 * Setter for libraries.
	 * 
	 * @param libraries
	 *            the libraries to set
	 */
	public void setLibraries(Set<Key> libraries) {
		this.libraries = libraries;
	}

	/**
	 * Getter for itemImages.
	 * 
	 * @return itemImages
	 */
	public List<ItemImage> getItemImages() {
		return itemImages;
	}

	/**
	 * Setter for itemImages.
	 * 
	 * @param itemImages
	 *            the itemImages to set
	 */
	public void setItemImages(List<ItemImage> itemImages) {
		this.itemImages = itemImages;
	}
}
